package com.xian.im.modules.security;


import com.xian.im.common.utils.sys.ThreadLocalUtil;

/**
 * @program: xian-im-server
 * @description:
 * @author: liru.xian
 * @create: 2021-03-09 10:54
 **/
public class TokenUtil {


    public static BaseClaims  getBaseClaims (){
        Object o = ThreadLocalUtil.get(TokenProvider.USER_CLAIMS);
        if (o != null) {
            BaseClaims baseClaims = (BaseClaims) o;
            return baseClaims;
        }
        return null;
    }

    public static String  getAccount (){
        BaseClaims baseClaims = getBaseClaims ();
        if (baseClaims != null) {
            return baseClaims.getUserAccount();
        }
        return null;
    }

}
